package com.xys.auth.mapper;

import com.xys.auth.bean.Syslog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SyslogMapper {
    @Select("select * from sys_log")
    @Results({
            @Result(id=true,column="id",property="id"),
            @Result(column="visit_time",property="visitTime"),
            @Result(column="ip",property="ip"),
            @Result(column="url",property="url"),
            @Result(column="execution_time",property="executionTime"),
            @Result(column="method",property="method"),
            @Result(column="username",property="username")
    })
    public List<Syslog> findAll() throws Exception;

    @Insert("insert into sys_log values(#{id},#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    public void save(Syslog log) throws Exception;
}
